package com.daybook.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.daybook.pojo.User;

public interface UserMapper {
	
	/**
	 * 用户模块
	 * */
	//用户登录验证
    User selectByNameAndPwd(@Param(value = "user")User user);
    //用户注册
    int insertNewUser(@Param(value = "user")User user);
    //注册验证，不能有重名用户
    int selectByUserName(@Param(value = "uname")String uname);
    //用户修改密码
    int updateUserByPwd(@Param(value = "uid")int uid,@Param(value = "pwd")String pwd);
    //用户信息管理
    int updateUserByUid(@Param(value = "user")User user);
  //用户折扣信息
    double selectUserMember(@Param(value = "uid")int uid);
    //更新用户积分
    int updateUserByIntegral(@Param(value = "user")User user);
  //用户会员等级
    String selectUserMemberGrade(@Param(value = "uid")int uid);
	/**
	 * 管理员模块
	 * */
	
	//分页查询用户
	 List<User> selectUserByPage( @Param(value = "startPos")Integer startPos,
	    		@Param(value = "pageSize")Integer pageSize,@Param(value = "user")User user);
	
	 int getUserCount(@Param(value = "user")User user);
	 //通过用户名查询
	 	//User selectUserByName(@Param(value = "name")String name);
	 //更改用户状态
	 int changeUserByState(@Param(value = "id")int id,@Param(value = "state")int state);
}
